function gadget:GetInfo()
   return {
      name      = "Respawner",
      desc      = "respawns deceased units",
      author    = "Peeps",
      date      = "w/e",
      license   = "to kill",
      layer     = 0,
      enabled   = true,
   }
end


if (not gadgetHandler:IsSyncedCode()) then
   return false
end

function gadget:TeamDied(teamID)
	gadgetHandler:RemoveGadget()
end

function gadget:UnitDestroyed(unitID, unitDefID, teamID, attackerID)
	if GG['gameEnded'] == false and attackerID ~= nil then
		-- Respawning on death information
		-- we might want to make these relative to the TeamStartPosition so the units don't "stack"
		local x,y,z = Spring.GetTeamStartPosition(teamID)
		-- change the facing direction to be relative?
		Spring.CreateUnit(unitDefID, x+math.random(-150, 150), y, z+math.random(-150, 150), "east", teamID)
	end
end

